package com.myapp.web.aop;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;

public class ActionMethodInterceptor implements MethodInterceptor {

	private static final Logger logger = LoggerFactory.getLogger(ActionMethodInterceptor.class);
	
	@Override
	public Object invoke(MethodInvocation mi) throws Throwable {
		try
		{
			return mi.proceed();
		}catch(Throwable e)
		{
			logger.warn("exception :" + mi.getClass() + "," + mi.getMethod().getName(),e);
			throw e;
		}
	}
}
